package com.framework.bas.util;

/**
 *@version  2009 
 */
public class CodeBuilder {

	private String sqlID;			//生成主键的sqlid
	
	private int codeLength;			//主键长度,前面补零
	
	private String superCode;		//父级主键
	
	private boolean isBlockOut;		//是否存在中心划分
	
	private String keyName;			//序列名称
	

	public String getSqlID() {
		return sqlID;
	}

	public void setSqlID(String sqlID) {
		this.sqlID = sqlID;
	}

	public int getCodeLength() {
		return codeLength;
	}

	public void setCodeLength(int codeLength) {
		this.codeLength = codeLength;
	}

	public String getSuperCode() {
		return superCode;
	}

	public void setSuperCode(String superCode) {
		this.superCode = superCode;
	}

	public boolean isBlockOut() {
		return isBlockOut;
	}

	public void setBlockOut(boolean isBlockOut) {
		this.isBlockOut = isBlockOut;
	}
	
	public String getKeyName() {
		return keyName;
	}

	public void setKeyName(String keyName) {
		this.keyName = keyName;
	}

	/**
	 * 空构造
	 */
	public CodeBuilder() {
		// TODO Auto-generated constructor stub
	}
	
	/**
	 * 单一型
	 * @param sqlID 计算现有的记录数
	 * @param codeLength	主键的长度
	 */
	public CodeBuilder(String sqlID,int codeLength) {
		this.sqlID = sqlID;
		this.codeLength = codeLength;
		this.superCode = null;
		this.isBlockOut = false;
	}
	
	public CodeBuilder(String sqlID,int codeLength,boolean isBlackOut) {
		this.sqlID = sqlID;
		this.codeLength = codeLength;
		this.superCode = null;
		this.isBlockOut = isBlackOut;
	}
	
	/**
	 * 升序序列，无长度限制
	 * @param sqlID 计算现有的记录数
	 * 
	 */
	public CodeBuilder(String sqlID) {
		this.sqlID = sqlID;
		this.superCode = null;
	}
	
	/**
	 * 复合型
	 * @param sqlID	计算现有的记录数
	 * @param superCode	父级主键ID
	 */
	public CodeBuilder(String sqlID,String superCode) {
		this.sqlID = sqlID;
		this.codeLength = 0;
		this.superCode = superCode;
		this.isBlockOut = false;
	}
	
	public CodeBuilder(String sqlID,String superCode,int codeLength) {
		this.sqlID = sqlID;
		this.codeLength = codeLength;
		this.superCode = superCode;
		this.isBlockOut = false;
	}
	
	public CodeBuilder(String sqlID,String superCode,boolean isBlackOut) {
		this.sqlID = sqlID;
		this.codeLength = 0;
		this.superCode = superCode;
		this.isBlockOut = isBlackOut;
	}
	
	public CodeBuilder(String sqlID,int codeLength,String superCode,boolean isBlockOut) {
		this.sqlID = sqlID;
		this.codeLength = codeLength;
		this.superCode = superCode;
		this.isBlockOut = isBlockOut;
	}
	
	
}
